<template>
  <div class="big">
    <div id="bigbox">
      <div>
        <img src="xq4.jpg" alt="" />
      </div>
      <div>
        <div class="er">2022年大学英语四级考</div>
        <div class="er">试备考包|1件包邮再领</div>
        <div class="xin">新四级真题备考包(现在下</div>
        <div class="x">x1</div>
      </div>
      <div class="erw">￥39.00</div>
    </div>
    <div class="sp">
      <div class="yang">商品总价</div>
      <div class="san">39.00</div>
    </div>
    <div class="sp ">
      <div class="yf">
          <div class="yang">邮费</div>
          <div class="man">满50包邮</div>
      </div>
      <div class="sann">0.00</div>
    </div>
    <div class="sp">
      <!-- ================优惠券============== -->
      <!-- 优惠券单元格 -->
      <van-coupon-cell
        :coupons="coupons"
        :chosen-coupon="chosenCoupon"
        @click="showList = true"
      />
      <!-- 优惠券列表 -->
      <van-popup
        v-model="showList"
        round
        position="bottom"
        style="height: 90%; padding-top: 4px"
      >
        <van-coupon-list
          :coupons="coupons"
          :chosen-coupon="chosenCoupon"
          :disabled-coupons="disabledCoupons"
          @change="onChange"
          @exchange="onExchange"
        />
      </van-popup>
    </div>
    <div class="sp">
      <div class="yang">订单备注</div>
      <div>在这里说明你的要求哦</div>
    </div>
  </div>
</template>

<script>
const coupon = {
  available: 1,
  condition: "无使用门槛\n最多优惠12元",
  reason: "",
  value: 150,
  name: "优惠券名称",
  startAt: 1489104000,
  endAt: 1514592000,
  valueDesc: "1.5",
  unitDesc: "元",
};

export default {
  data() {
    return {
      chosenCoupon: -1,
      coupons: [coupon],
      disabledCoupons: [coupon],
      showList: true,
    };
  },
  methods: {
    onChange(index) {
      this.showList = false;
      this.chosenCoupon = index;
    },
    onExchange() {
      this.coupons.push(coupon);
    },
  },
};
</script>

<style scoped>
.big {
  margin-top: 0.2rem;
  width: 3.42rem;
  margin: 0 auto;
}
#bigbox {
  margin-top: 0.2rem;
  width: 3.42rem;
  display: flex;
}
img {
  width: 1.17rem;
  height: 1.07rem;
}
.xin {
  font-size: 0.14rem;
  margin: 0.1rem 0rem;
}
.x {
  font-size: 0.14rem;
}
.er {
  font-size: 0.15rem;
  font-weight: 600;
}
.yang {
  font-size: 0.15rem;
  font-weight: 600;
}
.erw {
  padding-left: 0.02rem;
  font-size: 0.16rem;
  font-weight: 800;
}
.van-cell {
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  color: #323233;
   font-size: 0.15rem;
  font-weight: 600;
  line-height: .24rem;
  background-color: #fff;
}
.sp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 0.5rem;
  /* background: pink; */
}
.yf{
    display: flex;
}
.small {
  display: flex;
}
.man {
  width: 0.67rem;
  font-size: 0.1rem;
  height: 0.23rem;
  background: #e6c5b6;
  color: #fb5a39;
  text-align: center;
  line-height: 0.23rem;
  border-radius: 0.02rem;
  margin-left: 0.1rem;
  -webkit-transform: scale(0.833);
}
.van-cell {
 
    padding: 0rem 0rem;
}
.van-cell::after {
    position: absolute;
    box-sizing: border-box;
    content: ' ';
    pointer-events: none;
    right: .16rem;
    bottom: 0;
    left: .16rem;
    -webkit-transform: scaleY(.5);
    transform: scaleY(.5);
}
.van-cell__value {
    color: #c2c3c5;
    text-align: right;
    font-size: .14rem;
    vertical-align: middle;
    word-wrap: break-word;
}
.boxa {
  display: flex;
}
.san {
  font-size: 0.16rem;
  font-weight: 800;
}
.sann{
  font-size: 0.16rem;
  font-weight: 800;
  color: rgb(190, 185, 185);
}
.ling {
  color: rgb(205, 216, 216);
  font-size: 0.16rem;
  /* font-weight: 400; */
}
</style>